package com.itheima.api_date.lambda;

/**
 * @author Anomaly
 * @date 2022/12/31 19:25
 */
public class LambdaDemo {
    public static void main(String[] args) {
        Animal animal = new Animal() {
            @Override
            public void run() {
                System.out.println("Animal--run");
            }
        };
        animal.run();

        System.out.println("===========================");

        //lambda表达式
        Student student = () -> System.out.println("Student--study");
        student.study();
    }
}

@FunctionalInterface
interface Student {
    void study();
}

abstract class Animal {
    public abstract void run();
}
